const mongoose = require('mongoose');//引入mongoose
const studentsSchema = new mongoose.Schema({
    name: String,
    age: Number,
    sex: String,
    imgSrc:String,
    classId: {
        type: mongoose.SchemaTypes.ObjectId,
        //关联集合模型，集合模型名在mongoose.model注册的名字
        ref:'classesModel'
    }
});

const studentsModel = mongoose.model("studentsModel", studentsSchema, "students");
module.exports = {studentsModel}